<template>
  <el-dialog
    title="设置刷新时间`"
    :visible.sync="dialogVisible"
    width="30%"
    :close-on-click-modal="false"
    :before-close="close"
  >
    <div>
      <el-form
        ref="RefForm"
        :model="formData"
        label-width="120px"
        :rules="formRules"
        status-icon
      >
        <el-form-item label="时间刷新模式" prop="deptCode">
          <el-input v-model="formData.deptCode"></el-input>
        </el-form-item>
        <el-form-item label="设置时间" prop="deptName">
          <el-input v-model="formData.deptName"></el-input>
        </el-form-item>
      </el-form>
    </div>
    <div slot="footer" class="dialog-footer">
      <el-button @click="close">取 消</el-button>
      <el-button
        :loading="loadingSubmit"
        type="primary"
        @click="handleSubmit"
      >确 定</el-button>
    </div>
  </el-dialog>
</template>

<script>
  import dialogEditMixin from '@/mixins/dialogEdit'
  export default {
    mixins: [dialogEditMixin],
    data() {
      return {
        options: [],
        formRules: {
          deptCode: [
            { required: true, message: '请输入部门编码', trigger: 'blur' }
          ]
        },
        apiKey: {
          search: 'department/search',
          add: 'department/add',
          put: 'department/put'
        }
      }
    },
    methods: {
      resetFormData() {
        this.formData = {
          deptCode: '',
          deptName: '',
          number: ''
        }
      },
      // async getDepartmentList() {
      //   const result = await this.$api['department/list']({
      //     pageIndex: 1,
      //     pageSize: 10
      //   })
      //   if (result.code === 200) {
      //     this.options = []
      //     result.data.items.forEach(item => {
      //       this.options.push({
      //         label: item.deptName,
      //         value: item.id
      //       })
      //     })
      //   }
      // }
    }
  }
</script>

<style lang="scss" scoped></style>
